<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>WelCome to HuNan University JudgeOnline</title>
    <link rel="stylesheet" href="style/nav.css" >
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="css/bootstrap.min.css">

    <!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
    <link rel="stylesheet" href="css/bootstrap-theme.min.css">

    <!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
    <script src="js/jquery-3.3.1.min.js"></script>
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="js/bootstrap.min.js"></script>
    <!-- 自己的js文件 -->
    <script src="js/controller.js"></script>
    <script src="js/myajax.js"></script>
    <script src="js/filter.js"></script>
    <script>
        function goPage(page) {
            if (page < 1) {
                page = 1;
            }
            var data = new Object();
            var t = document.getElementById("problemId").value;
            data.problemId = (isBlank(t)? null : t);
            t = document.getElementById("userId").value;
            data.name = (isBlank(t)? null : t);
            t = document.getElementById("lang").value;
            data.lang = (isBlank(t)? null : t);
            t = document.getElementById("result").value;
            data.state = (isBlank(t)? null : t);
            data.page = String(page);
            status(data);
        }
    </script>
</head>
<body>
    <div class="container">
        <!-- page head -->
        <div class="head-logo">
            <img alt="hnulogo" src="img/hnulogo.gif">
            <h2>Welcome To Hunan University Judge Online</h2>
            <img alt="acmlogo" src="img/acm.png" class="img-circle icpc" />
        </div>
        <div class="masthead">
            <ul class="nav nav-pills">
                <li id="home"><a href="index">Home</a></li>
                <li id="problem"><a href="problemset">Problem</a></li>
                <li id="contest"><a href="contest">Contest</a></li>
                <li id="status"><a href="status">Status</a></li>
                <li id="rank"><a href="rank">Rank</a></li>
                <li id="user"><a href="discuss">Discuss</a></li>
                <li id="about"><a href="fas">FAQ</a></li>
                <li class="pull-right" id="info">
                    <button type="button" class="btn btn-primary" onclick="preLogin()">Login</button>
                    <button type="button" class="btn btn-primary" onclick="preRegister()">Register</button>
                </li>
            </ul>
        </div>

        <!-- Site content-->
        <div class="row">
            <div class="col-md-12 column">
                <nav class="navbar navbar-fixed-bottom navbar-inverse" role="navigation">
                    <div class="navbar-form" style="margin-left: 10vw">
                        <span style="color: white">Page: </span>
                        <input id="pageInput" type="text" class="form-control" style="width: 3em" value="1" />
                        <button id="submitPage" type="button" class="form-control" style="margin-right: 10em">Go</button>
                        <input id="problemId" type="number" class="form-control" placeholder="Problem ID" />
                        <input id="userId" type="text" class="form-control" placeholder="User ID" />
                        <select id="lang" class="form-control">
                            <option value="">All</option>
                            <option value="1">GCC</option>
                            <option value="2">G++</option>
                            <option value="3">Java</option>
                            <option value="4">Pascal</option>
                            <option value="5">Python</option>
                        </select>
                        <select id="result" class="form-control">
                            <option value="">ALL</option>
                            <option value="0">AC</option>
                            <option value="1">MLE</option>
                            <option value="2">TLE</option>
                            <option value="3">RE</option>
                            <option value="4">OL</option>
                            <option value="5">DC</option>
                            <option value="6">CE</option>
                            <option value="7">WA</option>
                            <option value="8">PE</option>
                        </select>
                        <button id="submitSearch" type="button" class="btn btn-default">
                            Search
                        </button>
                    </div>
                </nav>
                <table class="table table-hover" id="tableList">
                    <thead>
                        <tr>
                            <th>
                                Solution
                            </th>
                            <th>
                                Problem
                            </th>
                            <th>
                                User
                            </th>
                            <th>
                                Language
                            </th>
                            <th>
                                Result
                            </th>
                            <th>
                                Memory
                            </th>
                            <th>
                                Time
                            </th>
                            <th>
                                Code Length
                            </th>
                            <th>
                                Submit Time
                            </th>
                        </tr>
                    </thead>
                </table>
                <ul class="pagination" id="page-top">
                    <li>
                        <a href="javascript:void(0)" onclick="goPage(1)" id="start">&laquo;</a>
                    </li>
                    <li>
                        <a href="javascript:void(0)" id="pre"> < </a>
                    </li>
                    <li>
                        <a class="disabled">...</a>
                    </li>
                    <li>
                        <a href="javascript:void(0)" id="nowPage">1</a>
                    </li>
                    <li>
                        <a class="disabled">...</a>
                    </li>
                    <li>
                        <a href="javascript:void(0)" id="next"> > </a>
                    </li>
                    <li>
                        <a href="javascript:void(0)" id="end">&raquo;</a>
                    </li>
                </ul>
            </div>
        </div>
        <!--（Modal） -->
        <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title" id="myModalLabel"></h4>
                    </div>
                    <div class="modal-body">
                        <textarea id="showCode" style="width: 100%; height: 20em" readonly="readonly"></textarea>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
                    </div>
                </div><!-- /.modal-content -->
            </div><!-- /.modal -->
        </div>
  
        <!-- Site footer -->
        <footer class="footer">
            <p>&copy; HNU ACM Team | <a href="#">Contact Us</a> | Version 2018</p>
            <p>Developer：balabala</p>
        </footer>
  
    </div>
</body>
<script>
    $("#status").addClass("active");
    $("#submitSearch").click(function() {
        goPage(1);
    })
    $("#submitPage").click(function() {
        var page = document.getElementById("pageInput").value;
        goPage(page);
    })
    // showCode(73);
    goPage(1);
</script>
<script src="js/afterLoad.js"></script>
</html>